package com.example.indenture.team.entity;

import com.example.indenture.common.entity.AbstractEntity;
import com.example.indenture.race.entity.Race;
import com.example.indenture.user.entity.User;
import lombok.Data;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Data
@Entity
@Table(name = "team")
public class Team extends AbstractEntity {
    private String name;

    private int lid;

    private int smid;
    @ManyToMany
    @JoinTable(
            name = "team_user",
            joinColumns = {
                    @JoinColumn(name = "tid", referencedColumnName = "id")
            },
            inverseJoinColumns = {
                    @JoinColumn(name = "uid", referencedColumnName = "id")
            }
    )
    private List<User> userList = new ArrayList<>();

    private Integer vercode;

    private int rid;
    private String url;
    private int pass;
    @Transient
    private Integer userNum;

    @Transient
    private User leader;

    @Transient
    private Race race;


}
